import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {Observable} from "rxjs";

@Injectable({
  providedIn: 'root'
})
export class UserService {
    private baseUrl = 'http://localhost:8080/manager';

    constructor(private http: HttpClient) {
    }

    getUsers(username: string, country: string): Observable<any> {
        const url = `${this.baseUrl}/users?username=${username}&country=${country}`;
        return this.http.get<any>(url);
    }

}
